package com.zimin.cloud.file.api;

import com.zimin.cloud.mine.pojo.file.business.FaceBO;
import com.zimin.shared.pojo.Result;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.http.MediaType;
import org.springframework.web.bind.annotation.*;
import org.springframework.web.multipart.MultipartFile;

import javax.servlet.http.HttpServletResponse;

/**
 * @author zimin
 * @since 2021/10/27 6:01 下午
 */
@FeignClient(value = IBaseFileFeign.SERVER_NAME)
public interface IGridFsFeign {

    String PREFIX = "/file/gridFs";

    /**
     * 上传单图
     *
     * @return
     */
    @PostMapping(PREFIX + "/uploadFace")
    Result uploadFace(@RequestBody FaceBO faceBO) throws Exception;

    /**
     * 查询人脸图片
     *
     * @return
     * @throws Exception
     */
    @GetMapping(PREFIX + "/readInGridFs")
    void readInGridFs(@RequestParam(name = "faceId") String faceId, HttpServletResponse response) throws Exception;


    /**
     * 从gridFs中读取图片数据
     *
     * @param faceId
     * @return
     * @throws Exception
     */
    @GetMapping(PREFIX + "/readFace64InGridFs")
    Result readFace64InGridFs(@RequestParam(name = "faceId") String faceId) throws Exception;

}
